﻿/*
  In App.xaml:
  <Application.Resources>
      <vm:ViewModelLocatorTemplate xmlns:vm="clr-namespace:WpfApplication1"
                                   x:Key="Locator" />
  </Application.Resources>
  
  In the View:
  DataContext="{Binding Source={StaticResource Locator}, Path=ViewModelName}"

  You can also use Blend to do all this with the tool's support.
  See http://www.galasoft.ch/mvvm
*/

using GalaSoft.MvvmLight;
using HouseKeepingPL.HKService;

namespace HouseKeepingPL.ViewModel
{
    /// <summary>
    /// This class contains static references to all the view models in the
    /// application and provides an entry point for the bindings.
    /// </summary>
    public class ViewModelLocator
    {
        private static MainViewModel _main;
        private static ReportViewModel _reportsVM;      // view model for reports
        private static IncomesViewModel _incomesViewModel;  // view model for the incomes
        private static OutcomesViewModel _outcomesViewModel; // view model for the outcomes
        private static AccountViewModel _accountViewModel; // view model for account control

        /// <summary>
        /// Initializes a new instance of the ViewModelLocator class.
        /// </summary>
        public ViewModelLocator()
        {
            if (ViewModelBase.IsInDesignModeStatic)
            {
                return;

            }
            else
            {
                _accountViewModel = new AccountViewModel();
                _incomesViewModel = new IncomesViewModel();
                _outcomesViewModel = new OutcomesViewModel();
                _reportsVM = new ReportViewModel();
                _main = new MainViewModel();
                

            }



            //_loginViewModel = new LoginViewModel();
        }

        /// <summary>
        /// Gets the Main property which defines the main viewmodel.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance",
            "CA1822:MarkMembersAsStatic",
            Justification = "This non-static member is needed for data binding purposes.")]
        public MainViewModel Main
        {
            get
            {
                return _main;
            }
        
        }

        /// <summary>
        /// Gets the Report property which defines the Report viewmodel.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance",
            "CA1822:MarkMembersAsStatic",
            Justification = "This non-static member is needed for data binding purposes.")]
        public ReportViewModel ReportVM
        {
            get
            {
                return _reportsVM;
            }
        }

        /// <summary>
        /// Gets the Report property which defines the incomes viewmodel.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance",
            "CA1822:MarkMembersAsStatic",
            Justification = "This non-static member is needed for data binding purposes.")]
        public IncomesViewModel IncomesVM
        {
            get
            {
                return _incomesViewModel;
            }
        }

        /// <summary>
        /// Gets the Report property which defines the incomes viewmodel.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance",
            "CA1822:MarkMembersAsStatic",
            Justification = "This non-static member is needed for data binding purposes.")]
        public OutcomesViewModel OutcomesVM
        {
            get
            {
                return _outcomesViewModel;
            }
        }

        /// <summary>
        /// Gets the Report property which defines the incomes viewmodel.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance",
            "CA1822:MarkMembersAsStatic",
            Justification = "This non-static member is needed for data binding purposes.")]
        public AccountViewModel AccountVM
        {
            get
            {
                return _accountViewModel;
            }
        }

    }
}